## 单元测试的CMakeLists.txt文件

find_package(GTest REQUIRED)
find_package(uthash REQUIRED)

add_executable(miscellaneous_test miscellaneous_test.cpp)
message("miscellaneous_test target created")

target_link_libraries(miscellaneous_test thmar::thmar GTest::GTest GTest::Main)

add_executable(thread_safe_map_test thread_safe_map_test.cpp)
message("thread_safe_map_test target created")

target_link_libraries(thread_safe_map_test thmar::thmar GTest::GTest GTest::Main uthash::uthash)

if(WITH_PAHO)
    find_package(eclipse-paho-mqtt-c REQUIRED)
    find_package(cJSON REQUIRED)
    
    add_executable(paho_pubish_test paho_publish_test.cpp)
    message("paho_pubish_test target created")
    target_link_libraries(paho_pubish_test thmar::thmar GTest::GTest GTest::Main)

    add_executable(paho_subasync_test paho_subasync_test.cpp)
    message("paho_subasync_test target created")
    target_link_libraries(paho_subasync_test thmar::thmar GTest::GTest GTest::Main)

    add_executable(subasync_test subasync.cpp)
    message("subasync_test target created")
    target_link_libraries(subasync_test GTest::GTest GTest::Main eclipse-paho-mqtt-c::paho-mqtt3c-static)

    add_executable(mqinvoker_getDevice_test mqinvoker_getDevice_test.cpp)
    message("mqinvoker_getDevice_test target created")
    target_link_libraries(mqinvoker_getDevice_test  thmar::thmar cjson::cjson)

    add_executable(mqinvoker_addDevice_test mqinvoker_addDevice_test.cpp)
    message("mqinvoker_addDevice_test target created")
    target_link_libraries(mqinvoker_addDevice_test  thmar::thmar cjson::cjson)

    add_executable(mqinvoker_updateDevice_test mqinvoker_updateDevice_test.cpp)
    message("mqinvoker_updateDevice_test target created")
    target_link_libraries(mqinvoker_updateDevice_test  thmar::thmar cjson::cjson)

endif()